<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="admin/Hui/lib/html5.js"></script>
<script type="text/javascript" src="admin/Hui/lib/respond.min.js"></script>
<script type="text/javascript" src="admin/Hui/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="admin/Hui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="admin/Hui/css/H-ui.admin.css" rel="stylesheet"
	type="text/css" />
<link href="admin/Hui/lib/font-awesome/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="admin/Hui/lib/font-awesome/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href="admin/Hui/lib/iconfont/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="admin/Hui/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<script type="text/javascript" src="admin/Hui/js/jquery-1.7.2.js"></script>
<title>商品管理</title>
<style>
.navul ul li {
	float: left;
	padding-left: 5px;
	text-align: center;
}

.navul {
	width: 500px;
	height: 32px;
	margin: auto;
}

.picture-thumb{
	height: 50px;
	
}
</style>
<script>
	function del() {
		if (confirm("可能连下级菜单一起删除，确定删除记录吗?")) {
			return true;
		} else {
			return false;
		}
	}

	function moredelete() {
		var chk_value = [];
		$('input[name="check_id"]:checked').each(function() {
			chk_value.push($(this).val());
		});
		if (chk_value.length == 0) {
			alert("未选择");
		} else {
			var mes = confirm("可能连下级菜单一起删除，确定要删除记录吗?");
			if (mes == true) {
				$("#formdelete").submit();
			}
		}
	}
</script>
</head>
<body>
	<nav class="breadcrumb">
		<span><img src="admin/images/leftico01.png" /></span> 商品管理 <span
			class="c-gray en">&gt;</span> 商品管理 <span
			class="c-gray en">&gt;</span> 商品列表<a
			class="btn btn-success radius r mr-20"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="icon-refresh"></i></a>
	</nav>
	<div class="pd-20">
		<div class="text-c">
			<input type="text" class="input-text"
				style="width: 250px" placeholder="输入商品类别" id="searchname"
				name="searchname">
			<button type="button" class="btn btn-success" id="tosubmit">
				<i class="icon-search"></i> 搜商品
			</button>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l"><a id="moredelete"
				class="btn btn-danger radius" onclick="moredelete()"><i
					class="icon-trash"></i> 批量删除</a> <a href="product!addModel.action"
				class="btn btn-primary radius"> <i class="icon-plus"></i> 添加商品
			</a></span> <span class="r"> 共有数据：<strong>88</strong> 条
			</span>
		</div>
		<form action="product!moredelete.action" method="post" id="formdelete">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>

					<tr class="text-c">
						<th width="25"><input type="checkbox" name="" value=""></th>
						<th width="80">ID</th>
						<th width="150">商品名称</th>
						<th width="200">商品图片</th>
						<th width="200">商品价格</th>
						<th width="200">发布时间</th>
						<th width="200">是否有货</th>
						<th width="200">类别</th>
						<th width="120">操作</th>
					</tr>

				</thead>
				<tbody>
					<s:iterator value="productList">
						<tr class="text-c">
							<td><input type="checkbox" value="${pro_id }"
								name="check_id"></td>
							<td>${pro_id }</td>
							
							<td><u style="cursor: pointer" class="text-primary"
								onclick="user_show('20001','600','','${pro_name }',
									'product!show.action?pro_id=${pro_id }')">${pro_name }</u></td>
							<td>
								<img class="picture-thumb" src="${pro_url }">
							</td>
							
							<td>
								${pro_price }
							</td>
							
							<td>
								${pro_time }
							</td>
							
							<td>
								<s:if test="pro_num==1">是</s:if> <s:elseif
									test="pro_num==0">否</s:elseif>
							</td>
							
							<td>
								${proType.pt_name }
							</td>
							<td class="f-14 user-manage"><a title="编辑"
								href="product!edit.action?pro_id=${pro_id }" class="ml-5"
								style="text-decoration: none"> <i class="icon-edit"></i></a> 
								<a title="删除" href="product!delete.action?pro_id=${pro_id }"
								onclick="return del()" class="ml-5"
								style="text-decoration: none"> <i class="icon-trash"></i>
							</a></td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
		</form>

	</div>

	<script>
	
function showPage(page){
		
		
	}
	</script>

	<div class="navul">

		<ul>
			<input type="hidden" id="maxPage" value="${countPage }" />
			<li><a onclick="showPage(1)" class="btn btn-danger radius">首页</a></li>
			<li><a id="pagePrevious"
				onclick="showPage(${curPage-1==0?1:curPage-1} )"
				class="btn btn-danger radius">上一页</a></li>
			<li><button id="pageNext"
				onclick="showPage(${curPage+1>countPage?countPage:curPage+1})"
				class="btn btn-danger radius">下一页</button></li>
			<li><a onclick="showPage(${countPage })"
				class="btn btn-danger radius">最后一页</a></li>
			<li><span class="btn btn-default disabled">第 ${curPage+1>countPage?countPage:curPage+1} 页</span></li>
			<li><span class="btn btn-default disabled">共 ${countPage } 页</span></li>
		</ul>


	</div>
	<script type="text/javascript" src="admin/Hui/lib/jquery.min.js"></script>
	<script type="text/javascript"
		src="admin/Hui/lib/layer1.8/layer.min.js"></script>
	<script type="text/javascript" src="admin/Hui/lib/laypage/laypage.js"></script>
	<script type="text/javascript"
		src="admin/Hui/lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="admin/Hui/lib/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.admin.js"></script>
	<script type="text/javascript" src="admin/Hui/js/H-ui.admin.doc.js"></script>
	<script type="text/javascript">
		$('.table-sort').dataTable({
			"lengthMenu" : false,//显示数量选择 
			"bFilter" : false,//过滤功能
			"bPaginate" : false,//翻页信息
			"bInfo" : false,//数量信息
			"aaSorting" : [ [ 1, "desc" ] ],//默认第几个排序
			"bStateSave" : true,//状态保存
			"aoColumnDefs" : [
			//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
			{
				"orderable" : false,
				"aTargets" : [ 0, 2, 3, 7, 8 ]
			} // 制定列不参与排序
			]
		});

		function user_resetpwd(id) {
			/* layer.confirm('确认要删除吗？',function(index){
				alert("123");
			}); */
			if (confirm('确认要重置密码吗？')) {
				$(".resetpwd").attr("href",
						"user!resetpwd.action?user_id=" + id);
				layer.msg('重置成功!', 2);
			}
		}
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "//hm.baidu.com/hm.js?080836300300be57b7f34f4b3e97d911";
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://"
				: " http://");
		document
				.write(unescape("%3Cscript src='"
						+ _bdhmProtocol
						+ "hm.baidu.com/h.js%3F080836300300be57b7f34f4b3e97d911' type='text/javascript'%3E%3C/script%3E"));
	</script>
</body>
</html>